﻿// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.

// Write your JavaScript code.
var AdminLTEOptions = {
    //Enable sidebar expand on hover effect for sidebar mini
    //This option is forced to true if both the fixed layout and sidebar mini
    //are used together
    sidebarExpandOnHover: true,
    //BoxRefresh Plugin
    enableBoxRefresh: true,
    //Bootstrap.js tooltip
    enableBSToppltip: true,
    animationSpeed: 100
};

var dtCn = {
    "sProcessing": "处理中...",
    "sLengthMenu": "显示 _MENU_ 项结果",
    "sZeroRecords": "没有匹配结果",
    "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
    "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
    "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
    "sInfoPostFix": "",
    "sSearch": "搜索:",
    "sUrl": "",
    "sEmptyTable": "表中数据为空",
    "sLoadingRecords": "载入中...",
    "sInfoThousands": ",",
    "oPaginate": {
        "sFirst": "首页",
        "sPrevious": "上页",
        "sNext": "下页",
        "sLast": "末页"
    },
    "oAria": {
        "sSortAscending": ": 以升序排列此列",
        "sSortDescending": ": 以降序排列此列"
    }
};
//全局默认配置
 //console.log($.fn.dataTable);
if ($.fn.dataTable) {
    $.extend($.fn.dataTable.defaults, {
        language: dtCn
        //searching: false,
        //ordering: false
    });
}

/*
*获取URL参数
*/
//function GetQueryString(name)
//{
//    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
//    var r = window.location.search.substr(1).match(reg);
//    if (r != null) {
//        return unescape(r[2]);
//    }
//    return null;
//}

// 添加 或者 修改 url中参数的值
//function UpdateUrlParam(name, val) {
//    var thisURL = document.location.href;

//    // 如果 url中包含这个参数 则修改
//    if (thisURL.indexOf(name+'=') > 0) {
//        var v = GetQueryString(name);
//        if (v != null) {
//            // 是否包含参数
//            thisURL = thisURL.replace(name + '=' + v, name + '=' + val);

//        }
//        else {
//            thisURL = thisURL.replace(name + '=', name + '=' + val);
//        }

//    } // 不包含这个参数 则添加
//    else {
//        if (thisURL.indexOf("?") > 0) {
//            thisURL = thisURL + "&" + name + "=" + val;
//        }
//        else {
//            thisURL = thisURL + "?" + name + "=" + val;
//        }
//    }
//    console.log(thisURL);
//    return thisURL;
//    //location.href = thisURL;

//};